package controller;

import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServlet;
import java.io.IOException;
import java.util.Date;

/**
 * @author ：Teacher陈（86521760@qq.com）
 * @date ：Created in 2022/3/21 11:39
 * @description：我的第一个servlet类
 * @modified By：
 * @version: 1.0
 */
public class MySecondServlet extends HttpServlet {

    @Override
    public void destroy() {
        System.out.println("MySecondServlet销毁了");
    }

    @Override
    public void init() throws ServletException {
        System.out.println("MySecondServlet初始化了");
    }

    @Override
    public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {
        String age = req.getParameter("age");
        System.out.println(age+"的请求到达"+new Date());
    }
}
